<?php echo \Hook\Hook\Hook::run('displayFoot');?>
<script><?php
$data = [];
foreach (Yaconf::get('regexp')['core'] as $key => $value) {
    $data[] = $key.':/'.$value.'/';
}
echo 'var config = {regexp:{',join(',', $data),'}};';
?>

function hideOtherLanguage(id)
{
	$('.lang').hide();
	$('.lang-' + id).show();
}

function beforeSubmit()
{
    var form = $('#<?php echo $this->controller;?>_form');
    $.ajax({
        url: form.attr('action'),
        type: form.attr('method'),
        data: form.serialize(),
        success: function(data){
            if (data.code === 10000) {
                window.history.back();
                return true;
            }
            alert(data.id +':'+ data.msg);
        },
        error: function(data){
            alert('异常：' + data.responseJSON.id +':'+ data.responseJSON.msg);
        }
    });
}
</script>
<script src="https://cdn.bootcss.com/popper.js/1.14.4/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.perfect-scrollbar/1.4.0/perfect-scrollbar.min.js"></script>
<script src="/assets/vendor/stacked-menu/stacked-menu.min.js"></script>
<script src="/assets/javascript/theme.min.js"></script>

<script src="/assets/vendor/flatpickr/flatpickr.min.js"></script>
<script src="/assets/vendor/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
</body>
</html>